/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} name
 * @returns {Boolean}
 */
export function validString(name) {
  let reg = /^\s*$/g;
  return !reg.test(name);

}

/**
 * @param {string} phone
 * @returns {Boolean}
 */
export function validPhone(phone) {
  let reg = /^1[3456789]\d{9}$/;
  return reg.test(phone);

}

/**
 * @param {string} email
 * @returns {Boolean}
 */
export function validEmail(email) {
  let reg = /^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;
  return reg.test(email);

}
